package com.kk.adapter.objadapter;

/**
 * @author 王志强
 * @date 2021-12-16
 */
public class VoltageAdapter implements IVoltage5V {

    private Voltage220V voltage220V;

    /**
     * 使用聚合关系，代替继承
     */
    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int dst = voltage220V.output220V() / 44;
        return dst;
    }
}
